<?php
/**
 * 教师
 * User: Administrator
 * Date: 2022/3/24
 * Time: 15:19
 */

namespace app\api\controller;
use app\common\controller\Api;
use think\Request;
use think\Db;

class Teacher extends Api
{
    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';

    public function completionInformation()
    {
        if (!Request::instance()->isPost())
            $this->error('请求方式不正确');
        if(!$id = input('post.id'))
            $this->error('缺少参数');
        $params = input('post.');
        $result = $this->validate($params,'Teacher');

        if (true !== $result) {
            // 验证失败 输出错误信息
            $this->error($result);
        }

        $res = Db::name('teacher')->where('id',$id)->update($params);
        if($res)
            $this->success('资料补充成功');
        $this->error('资料补充失败');
    }
}